<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                template="/template/AdminTemplate.xhtml">

    <ui:define name="contentInsert">
        <h:form >
            <h:panelGrid columns="3">
                <h:outputLabel value="Select User: " />
                <h:selectOneMenu id="selectUserMenu" value="#{displayCustomerReservationMB.email}">
                    <f:selectItem itemValue="Select User: "/>
                    <f:selectItems var="u" value="#{displayCustomerReservationMB.allUsers}"
                                   itemValue="#{u.email}"
                                   itemLabel="#{u.email}"/>
                </h:selectOneMenu>
                <p:commandButton id="selectOutletSubmit" value="Go" ajax="false"
                                 update="reservations" >
                </p:commandButton>
            </h:panelGrid>


            <br/>
            <p:dataTable var="r" value="#{displayCustomerReservationMB.reservationByCust}" id="reservations">
                <f:facet name="header" >
                    <h:outputText value="Customer Reservation History"/>
                </f:facet>
                <p:column headerText="Reservation Id">
                    <h:outputText value="#{r.id}"/>
                </p:column>
                <p:column headerText="Outlet name" >
                    <h:outputText value="#{r.outlet.outletName}"/>
                </p:column>
                <p:column headerText="Date">
                    <h:outputText value="#{r.timeslot.time}"/>
                </p:column>
                <p:column headerText="Timeslot">
                    <h:outputText value="#{r.tsTime}"/>
                </p:column>
                <p:column headerText="Confirm Status">
                    <h:outputText value="#{r.confirmStatus?'Confirmed':'UnConfirmed'}"/>
                </p:column>
                <p:column headerText="Show Up">
                    <h:outputText value="#{r.customerShowUp?'Yes':'No'}"/>
                </p:column>

            </p:dataTable>  
        </h:form>
    </ui:define>

</ui:composition>
